#ifndef __MW_CYCLE_H__
#define __MW_CYCLE_H__

#include <map>
#include <string>
#include <tr1/functional>
struct event_base;

#define MW_DEBUG_POINTS_STOP   1                                                                                                                                                                                                       
#define MW_DEBUG_POINTS_ABORT  2

typedef void (*worker_main_fn)(struct event_base* base, void* data);
typedef void (*worker_exit_fn)(void* data);
typedef void (*master_on_child_fn)(void* data);

typedef std::tr1::function<int()> MasterEvent;
typedef struct 
{
    int num_processes;
    void (*worker_main_fn)(struct event_base* base, void* data);
    void (*worker_exit_fn)(void* data);
    void* worker_data;

    std::map<std::string, MasterEvent> hooks;

} mw_cycle_t;

#endif
